<template>
  <div class="home-page">
    <el-row class="header" type="flex" justify="center">
      <el-col :span="24" class="title">
        <h1>教师管理系统</h1>
        <p>欢迎使用教师信息管理系统，您的高效管理助手！</p>
      </el-col>
    </el-row>
    
    <el-row type="flex" justify="space-around" class="functionality">
      <el-col :span="5" class="card">
        <el-card>
          <h3>教师信息录入</h3>
          <p>添加新的教师信息到系统中，方便管理。</p>
          <el-button type="primary" @click="goToTeacherAdd">录入信息</el-button>
        </el-card>
      </el-col>
      
      <el-col :span="5" class="card">
        <el-card>
          <h3>教师信息查询</h3>
          <p>查询、查看已有的教师信息。</p>
          <el-button type="primary" @click="goToTeacherQuery">查询信息</el-button>
        </el-card>
      </el-col>
      
      <el-col :span="5" class="card">
        <el-card>
          <h3>数据统计</h3>
          <p>对教师信息进行统计分析，便于决策。</p>
          <el-button type="primary" @click="goToDataStatistics">查看统计</el-button>
        </el-card>
      </el-col>
    </el-row>

    <el-row type="flex" justify="center" class="footer">
      <el-col :span="24" class="footer-content">
        <p>&copy; 2024 教师管理系统 - 所有权</p>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'Home',
  methods: {
    // 跳转到教师信息录入页面
    goToTeacherAdd() {
  // 跳转到外部链接并附带参数 open=true
      window.location.href = 'http://127.0.0.1/teacher/info?open=true';
    },

    // 跳转到教师信息查询页面
    goToTeacherQuery() {
      window.location.href = 'http://127.0.0.1/teacher/info';
    },
    // 跳转到数据统计页面
    goToDataStatistics() {
      // this.$router.push({ name: 'Statistics' });
      window.location.href = 'http://127.0.0.1/teacher/total';
    }
  }
}
</script>

<style scoped>
.home-page {
  font-family: 'Arial', sans-serif;
  background-color: #f4f7fc;
}

.header {
  background-color: #3399FF;
  padding: 20px;
  color: white;
  text-align: center;
}

.title h1 {
  margin: 0;
  font-size: 36px;
}

.functionality {
  margin-top: 30px;
}

.card {
  margin-top: 20px;
}

.card h3 {
  font-size: 20px;
  color: #333;
}

.card p {
  font-size: 14px;
  color: #666;
}

.footer {
  background-color: #333;
  color: white;
  padding: 10px;
  text-align: center;
  margin-top: 30px;
}
</style>
